package com.ouyangtao.dao.impl;

import com.ouyangtao.dao.ISessionAggStatDAO;
import com.ouyangtao.domain.SessionAggStat;
import com.ouyangtao.jdbc.JDBCHelper;

public class SessionAggStatDAOImpl implements ISessionAggStatDAO {
    @Override
    public void insert(SessionAggStat sessionAggStat) {
        String sql = "insert into session_aggr_stat "
                + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

        Object[] params = new Object[]{sessionAggStat.getTaskId(),
                sessionAggStat.getSession_count(),
                sessionAggStat.getVisit_length_1s_3s_ratio(),
                sessionAggStat.getVisit_length_4s_6s_ratio(),
                sessionAggStat.getVisit_length_7s_9s_ratio(),
                sessionAggStat.getVisit_length_10s_30s_ratio(),
                sessionAggStat.getVisit_length_30s_60s_ratio(),
                sessionAggStat.getVisit_length_1m_3m_ratio(),
                sessionAggStat.getVisit_length_3m_10m_ratio(),
                sessionAggStat.getVisit_length_10m_30m_ratio(),
                sessionAggStat.getVisit_length_30m_ratio(),
                sessionAggStat.getStep_length_1_3_ratio(),
                sessionAggStat.getStep_length_4_6_ratio(),
                sessionAggStat.getStep_length_7_9_ratio(),
                sessionAggStat.getStep_length_10_30_ratio(),
                sessionAggStat.getStep_length_30_60_ratio(),
                sessionAggStat.getStep_length_60_ratio()};

        JDBCHelper jdbcHelper = JDBCHelper.getInstance();
        jdbcHelper.executeUpdate(sql,params);

    }
}
